package com.shuoyue.ycgk.ui.mine.order;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.GoodsItem;
import com.shuoyue.ycgk.entity.OrderGoods;

import java.util.List;

public class OrderGoodsAdapter extends AppBaseQuickAdapter<OrderGoods> {
    public OrderGoodsAdapter(@Nullable List<OrderGoods> data) {
        super(R.layout.item_order_goods, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderGoods item) {
        helper.addOnClickListener(R.id.lay_all);
        String type = "";
        switch (item.getProductType()) {
            case 1:
                type = "课程";
                break;
            case 2:
                type = "图书";
                break;
            case 4:
                type = "考前冲刺";
                break;
            case 5:
                type = "会员";
                break;
        }
        helper.setText(R.id.type, type);
        helper.setText(R.id.name, item.getTitle());
        helper.setText(R.id.price, "￥" + item.getProductPrice());
        helper.setText(R.id.num, "X" + item.getProductNum());

    }
}
